package cl.whyem.appbase.dao;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import cl.whyem.appbase.entities.User;
import cl.whyem.appbase.mappers.UserMapper;

/**
 * @author Siva
 *
 */
@Repository
public class UserDAO {

    @Autowired
    private UserMapper userMapper;

    public User findUserById(Integer userId) {
        return userMapper.findUserById(userId);
    }

    public List<User> findAllUsers() {
        return userMapper.findAllUsers();
    }

    /**
     * Traer los usuarios desde consulta en Mapper.xml
     */
    public List<User> traerTodos() {
        return userMapper.selectAllUser();
    }
}
